﻿using AutoMapper;
using BncMall.Model.DtoModels;
using BncMall.Model.Models;
using BncMall.Model.ViewModels;

namespace BncMall.AutoMapper
{
    public class ProductProfile : Profile
    {
        /// <summary>
        /// 配置构造函数，用来创建关系映射
        /// </summary>
        public ProductProfile()
        {
            CreateMap<Product_Spu, SpuDetailPageViewModel>().ReverseMap();
            CreateMap<Product_Spu, SpuShopDetailPageViewModel>().ReverseMap();
            CreateMap<Product_Spu, AddSpuDto>().ReverseMap();
            CreateMap<Product_Spu, UpdateSpuDto>().ReverseMap();
            CreateMap<Product_SpuPic, AddOrUpdateSpuPicDto>().ReverseMap();
            CreateMap<Product_Sku, AddOrUpdateSkuDto>().ReverseMap();
            CreateMap<Product_Spu, SpuDetailViewModel>().ReverseMap();
        }
    }
}
